%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%                                                                  %%%%%
%%%%    IEEE PES Power Grid Library - Optimal Power Flow - v19.05     %%%%%
%%%%          (https://github.com/power-grid-lib/pglib-opf)           %%%%%
%%%%               Benchmark Group - Typical Operations               %%%%%
%%%%                         10 - May - 2019                          %%%%%
%%%%                                                                  %%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%   Power flow data for IEEE 14 bus test case.
%   This data was converted from IEEE Common Data Format
%   (ieee14cdf.txt) on 20-Sep-2004 by cdf2matp, rev. 1.11
%
%   Converted from IEEE CDF file from:
%        http://www.ee.washington.edu/research/pstca/
%
%   Copyright (c) 1999 by Richard D. Christie, University of Washington
%   Electrical Engineering Licensed under the Creative Commons Attribution 4.0
%   International license, http://creativecommons.org/licenses/by/4.0/
%
%   CDF Header:
%   08/19/93 UW ARCHIVE           100.0  1962 W IEEE 14 Bus Test Case
%
function mpc = pglib_opf_case14_ieee
mpc.version = '2';
mpc.baseMVA = 100.0;

%% bus data
%	bus_i	type	Pd	Qd	Gs	Bs	area	Vm	Va	baseKV	zone	Vmax	Vmin
mpc.bus = [
	1	 3	 0.0	 0.0	 0.0	 0.0	 1	    1.00000	    0.00000	 1	 1	    1.06000	    0.94000;
	2	 2	 21.7	 12.7	 0.0	 0.0	 1	    1.00000	    0.00000	 1	 1	    1.06000	    0.94000;
	3	 2	 94.2	 19.0	 0.0	 0.0	 1	    1.00000	    0.00000	 1	 1	    1.06000	    0.94000;
	4	 1	 47.8	 -3.9	 0.0	 0.0	 1	    1.00000	    0.00000	 1	 1	    1.06000	    0.94000;
	5	 1	 7.6	 1.6	 0.0	 0.0	 1	    1.00000	    0.00000	 1	 1	    1.06000	    0.94000;
	6	 2	 11.2	 7.5	 0.0	 0.0	 1	    1.00000	    0.00000	 1	 1	    1.06000	    0.94000;
	7	 1	 0.0	 0.0	 0.0	 0.0	 1	    1.00000	    0.00000	 1	 1	    1.06000	    0.94000;
	8	 2	 0.0	 0.0	 0.0	 0.0	 1	    1.00000	    0.00000	 1	 1	    1.06000	    0.94000;
	9	 1	 29.5	 16.6	 0.0	 19.0	 1	    1.00000	    0.00000	 1	 1	    1.06000	    0.94000;
	10	 1	 9.0	 5.8	 0.0	 0.0	 1	    1.00000	    0.00000	 1	 1	    1.06000	    0.94000;
	11	 1	 3.5	 1.8	 0.0	 0.0	 1	    1.00000	    0.00000	 1	 1	    1.06000	    0.94000;
	12	 1	 6.1	 1.6	 0.0	 0.0	 1	    1.00000	    0.00000	 1	 1	    1.06000	    0.94000;
	13	 1	 13.5	 5.8	 0.0	 0.0	 1	    1.00000	    0.00000	 1	 1	    1.06000	    0.94000;
	14	 1	 14.9	 5.0	 0.0	 0.0	 1	    1.00000	    0.00000	 1	 1	    1.06000	    0.94000;
];

%% generator data
%	bus	Pg	Qg	Qmax	Qmin	Vg	mBase	status	Pmax	Pmin
mpc.gen = [
	1	 170.0	 5.0	 10.0	 0.0	 1.0	 100.0	 1	 340	 0.0; % NG
	2	 29.5	 0.0	 30.0	 -30.0	 1.0	 100.0	 1	 59	 0.0; % NG
	3	 0.0	 20.0	 40.0	 0.0	 1.0	 100.0	 1	 0	 0.0; % SYNC
	6	 0.0	 9.0	 24.0	 -6.0	 1.0	 100.0	 1	 0	 0.0; % SYNC
	8	 0.0	 9.0	 24.0	 -6.0	 1.0	 100.0	 1	 0	 0.0; % SYNC
];

%% generator cost data
%	2	startup	shutdown	n	c(n-1)	...	c0
mpc.gencost = [
	2	 0.0	 0.0	 3	   0.000000	   0.000000	   0.000000; % NG
	2	 0.0	 0.0	 3	   0.000000	   0.000000	   0.000000; % NG
	2	 0.0	 0.0	 3	   0.000000	   0.000000	   0.000000; % SYNC
	2	 0.0	 0.0	 3	   0.000000	   0.000000	   0.000000; % SYNC
	2	 0.0	 0.0	 3	   0.000000	   0.000000	   0.000000; % SYNC
];

%% branch data
%	fbus	tbus	r	x	b	rateA	rateB	rateC	ratio	angle	status	angmin	angmax
mpc.branch = [
	1	 2	 0.01938	 0.05917	 0.0528	 472	 472	 472	 0.0	 0.0	 1	 -30.0	 30.0;
	1	 5	 0.05403	 0.22304	 0.0492	 128	 128	 128	 0.0	 0.0	 1	 -30.0	 30.0;
	2	 3	 0.04699	 0.19797	 0.0438	 145	 145	 145	 0.0	 0.0	 1	 -30.0	 30.0;
	2	 4	 0.05811	 0.17632	 0.034	 158	 158	 158	 0.0	 0.0	 1	 -30.0	 30.0;
	2	 5	 0.05695	 0.17388	 0.0346	 161	 161	 161	 0.0	 0.0	 1	 -30.0	 30.0;
	3	 4	 0.06701	 0.17103	 0.0128	 160	 160	 160	 0.0	 0.0	 1	 -30.0	 30.0;
	4	 5	 0.01335	 0.04211	 0.0	 664	 664	 664	 0.0	 0.0	 1	 -30.0	 30.0;
	4	 7	 0.0	 0.20912	 0.0	 141	 141	 141	 0.978	 0.0	 1	 -30.0	 30.0;
	4	 9	 0.0	 0.55618	 0.0	 53	 53	 53	 0.969	 0.0	 1	 -30.0	 30.0;
	5	 6	 0.0	 0.25202	 0.0	 117	 117	 117	 0.932	 0.0	 1	 -30.0	 30.0;
	6	 11	 0.09498	 0.1989	 0.0	 134	 134	 134	 0.0	 0.0	 1	 -30.0	 30.0;
	6	 12	 0.12291	 0.25581	 0.0	 104	 104	 104	 0.0	 0.0	 1	 -30.0	 30.0;
	6	 13	 0.06615	 0.13027	 0.0	 201	 201	 201	 0.0	 0.0	 1	 -30.0	 30.0;
	7	 8	 0.0	 0.17615	 0.0	 167	 167	 167	 0.0	 0.0	 1	 -30.0	 30.0;
	7	 9	 0.0	 0.11001	 0.0	 267	 267	 267	 0.0	 0.0	 1	 -30.0	 30.0;
	9	 10	 0.03181	 0.0845	 0.0	 325	 325	 325	 0.0	 0.0	 1	 -30.0	 30.0;
	9	 14	 0.12711	 0.27038	 0.0	 99	 99	 99	 0.0	 0.0	 1	 -30.0	 30.0;
	10	 11	 0.08205	 0.19207	 0.0	 141	 141	 141	 0.0	 0.0	 1	 -30.0	 30.0;
	12	 13	 0.22092	 0.19988	 0.0	 99	 99	 99	 0.0	 0.0	 1	 -30.0	 30.0;
	13	 14	 0.17093	 0.34802	 0.0	 76	 76	 76	 0.0	 0.0	 1	 -30.0	 30.0;
];

%% candidate dc bus data
%column_names%   busdc_i grid    Pdc     Vdc     basekVdc    Vdcmax  Vdcmin  Cdc
mpc.busdc_ne = [
		1              1       0       1       345         1.1     0.9     0;
		2              1       0       1       345         1.1     0.9     0;
    3              1       0       1       345         1.1     0.9     0;
    4              1       0       1       345         1.1     0.9     0;
	  5              1       0       1       345         1.1     0.9     0;
		6              1       0       1       345         1.1     0.9     0;
		7              1       0       1       345         1.1     0.9     0;
		8              1       0       1       345         1.1     0.9     0;
		9              1       0       1       345         1.1     0.9     0;
		10              1       0       1       345         1.1     0.9     0;
		11              1       0       1       345         1.1     0.9     0;
		12              1       0       1       345         1.1     0.9     0;
		13              1       0       1       345         1.1     0.9     0;
		14              1       0       1       345         1.1     0.9     0;
];

%% candidate branches
%column_names%   fbusdc  tbusdc  r      l        c   rateA   rateB   rateC status cost
mpc.branchdc_ne = [
1	 2	 0.01938	 0.00	 0.00  472	 0.0	 0.0	 1.0	1;
1	 5	 0.05403	 0.00	 0.00  128	 0.0	 0.0	 1.0	1;
2	 3	 0.04699	 0.00	 0.00  145	 0.0	 0.0	 1.0	1;
2	 4	 0.05811	 0.00	 0.00  158	 0.0	 0.0	 1.0	1;
2	 5	 0.05695	 0.00	 0.00  161	 0.0	 0.0	 1.0	1;
3	 4	 0.06701	 0.00	 0.00  160	 0.0	 0.0	 1.0	1;
4	 5	 0.01335	 0.00	 0.00  664	 0.0	 0.0	 1.0	1;
4	 7	 0.01	 	 0.00	 0.00  141	 0.0	 0.0	 1.0	1;
4	 9	 0.01		 0.00	 0.00  53		 0.0	 0.0	 1.0	1;
5	 6	 0.01		 0.00	 0.00  117	 0.0	 0.0	 1.0	1;
6	 11	 0.09498	 0.00	 0.00  134	 0.0	 0.0	 1.0	1;
6	 12	 0.12291	 0.00	 0.00  104	 0.0	 0.0	 1.0	1;
6	 13	 0.06615	 0.00	 0.00  201	 0.0	 0.0	 1.0	1;
7	 8	 0.01	 	 0.00	 0.00  167	 0.0	 0.0	 1.0	1;
7	 9	 0.01	 	 0.00	 0.00  267	 0.0	 0.0	 1.0	1;
9	 10	 0.03181	 0.00	 0.00  325	 0.0	 0.0	 1.0	1;
9	 14	 0.12711	 0.00	 0.00  99		 0.0	 0.0	 1.0	1;
10	 11	 0.08205	 0.00	 0.00  141	 0.0	 0.0	 1.0	1;
12	 13	 0.22092	 0.00	 0.00  99		 0.0	 0.0	 1.0	1;
13	 14	 0.17093	 0.00	 0.00  76		 0.0	 0.0	 1.0	1;

1	 2	 0.01938	 0.00	 0.00  472	 0.0	 0.0	 1.0	1;
1	 5	 0.05403	 0.00	 0.00  128	 0.0	 0.0	 1.0	1;
2	 3	 0.04699	 0.00	 0.00  145	 0.0	 0.0	 1.0	1;
2	 4	 0.05811	 0.00	 0.00  158	 0.0	 0.0	 1.0	1;
2	 5	 0.05695	 0.00	 0.00  161	 0.0	 0.0	 1.0	1;
3	 4	 0.06701	 0.00	 0.00  160	 0.0	 0.0	 1.0	1;
4	 5	 0.01335	 0.00	 0.00  664	 0.0	 0.0	 1.0	1;
4	 7	 0.01	 	 0.00	 0.00  141	 0.0	 0.0	 1.0	1;
4	 9	 0.01	 	 0.00	 0.00  53		 0.0	 0.0	 1.0	1;
5	 6	 0.01	 	 0.00	 0.00  117	 0.0	 0.0	 1.0	1;
6	 11	 0.09498	 0.00	 0.00  134	 0.0	 0.0	 1.0	1;
6	 12	 0.12291	 0.00	 0.00  104	 0.0	 0.0	 1.0	1;
6	 13	 0.06615	 0.00	 0.00  201	 0.0	 0.0	 1.0	1;
7	 8	 0.01	 	 0.00	 0.00  167	 0.0	 0.0	 1.0	1;
7	 9	 0.01	 	 0.00	 0.00  267	 0.0	 0.0	 1.0	1;
9	 10	 0.03181	 0.00	 0.00  325	 0.0	 0.0	 1.0	1;
9	 14	 0.12711	 0.00	 0.00  99		 0.0	 0.0	 1.0	1;
10	 11	 0.08205	 0.00	 0.00  141	 0.0	 0.0	 1.0	1;
12	 13	 0.22092	 0.00	 0.00  99		 0.0	 0.0	 1.0	1;
13	 14	 0.17093	 0.00	 0.00  76		 0.0	 0.0	 1.0	1;

1	 2	 0.01938	 0.00	 0.00  472	 0.0	 0.0	 1.0	1;
1	 5	 0.05403	 0.00	 0.00  128	 0.0	 0.0	 1.0	1;
2	 3	 0.04699	 0.00	 0.00  145	 0.0	 0.0	 1.0	1;
2	 4	 0.05811	 0.00	 0.00  158	 0.0	 0.0	 1.0	1;
2	 5	 0.05695	 0.00	 0.00  161	 0.0	 0.0	 1.0	1;
3	 4	 0.06701	 0.00	 0.00  160	 0.0	 0.0	 1.0	1;
4	 5	 0.01335	 0.00	 0.00  664	 0.0	 0.0	 1.0	1;
4	 7	 0.01	 	 0.00	 0.00  141	 0.0	 0.0	 1.0	1;
4	 9	 0.01	 	 0.00	 0.00  53		 0.0	 0.0	 1.0	1;
5	 6	 0.01	 	 0.00	 0.00  117	 0.0	 0.0	 1.0	1;
6	 11	 0.09498	 0.00	 0.00  134	 0.0	 0.0	 1.0	1;
6	 12	 0.12291	 0.00	 0.00  104	 0.0	 0.0	 1.0	1;
6	 13	 0.06615	 0.00	 0.00  201	 0.0	 0.0	 1.0	1;
7	 8	 0.01	 	 0.00	 0.00  167	 0.0	 0.0	 1.0	1;
7	 9	 0.01	 	 0.00	 0.00  267	 0.0	 0.0	 1.0	1;
9	 10	 0.03181	 0.00	 0.00  325	 0.0	 0.0	 1.0	1;
9	 14	 0.12711	 0.00	 0.00  99		 0.0	 0.0	 1.0	1;
10	 11	 0.08205	 0.00	 0.00  141	 0.0	 0.0	 1.0	1;
12	 13	 0.22092	 0.00	 0.00  99		 0.0	 0.0	 1.0	1;
13	 14	 0.17093	 0.00	 0.00  76		 0.0	 0.0	 1.0	1;
];
%% candidate converters
%column_names%   busdc_i busac_i type_dc type_ac P_g   Q_g  islcc  Vtar rtf xtf  transformer tm   bf filter    rc      xc  reactor   basekVac Vmmax   Vmmin   Imax    status   LossA LossB  LossCrec LossCinv  droop Pdcset    Vdcset  dVdcset Pacmax Pacmin Qacmax Qacmin cost
	mpc.convdc_ne = [
		1       1   1       1       -360    -1.66   		0 1.0        0.001  0.01 1 1 0.01 1 0.001   0.01 1 345         1.1     0.9     9     1     	1.1033 0.887  2.885    2.885       0.0050    -52.7   1.0079   0 1000 -1000 500 -500 3;
		2       2   1       1       -360    -1.66   		0 1.0        0.001  0.01 1 1 0.01 1 0.001   0.01 1 345         1.1     0.9     9     1     1.1033 0.887  2.885    2.885         0.0050    -52.7   1.0079   0 1000 -1000 500 -500 3;
		3       3   1       1       -360    -1.66   		0 1.0        0.001  0.01 1 1 0.01 1 0.001   0.01 1 345         1.1     0.9     9     1     1.1033 0.887  2.885    2.885        0.0050    -52.7   1.0079   0 1000 -1000 500 -500 3;
		4       4   1       1       -360    -1.66   		0 1.0        0.001  0.01 1 1 0.01 1 0.001   0.01 1 345         1.1     0.9     9     1      1.1033 0.887  2.885    2.885        0.0050    -52.7   1.0079   0 1000 -1000 500 -500 3;
		5       5   1       1       -360    -1.66   		0 1.0        0.001  0.01 1 1 0.01 1 0.001   0.01 1 345         1.1     0.9     9     1      1.1033 0.887  2.885    2.885        0.0050    -52.7   1.0079   0 1000 -1000 500 -500 3;
		6       6   2       1       -360    -1.66   		0 1.0        0.001  0.01 1 1 0.01 1 0.001   0.01 1 345         1.1     0.9     9     1      1.1033 0.887  2.885    2.885         0.0050    -52.7   1.0079   0 1000 -1000 500 -500 3;
		7       7   1       1       -360    -1.66   		0 1.0        0.001  0.01 1 1 0.01 1 0.001   0.01 1 345         1.1     0.9     9     1     1.1033 0.887  2.885    2.885         0.0050    -52.7   1.0079   0 1000 -1000 500 -500 3;
		8       8   1       1       -360    -1.66   		0 1.0        0.001  0.01 1 1 0.01 1 0.001   0.01 1 345         1.1     0.9     9     1      1.1033 0.887  2.885    2.885         0.0050    -52.7   1.0079   0 1000 -1000 500 -500 3;
		9       9   2       1       -360    -1.66   		0 1.0        0.001  0.01 1 1 0.01 1 0.001   0.01 1 345         1.1     0.9     9     1      1.1033 0.887  2.885    2.885        0.0050    -52.7   1.0079   0 1000 -1000 500 -500 3;
		10      10   1       1       -360    -1.66   		0 1.0        0.001  0.01 1 1 0.01 1 0.001   0.01 1 345         1.1     0.9     9     1      1.1033 0.887  2.885    2.885        0.0050    -52.7   1.0079   0 1000 -1000 500 -500 3;
		11      11   2       1       -360    -1.66   		0 1.0        0.001  0.01 1 1 0.01 1 0.001   0.01 1 345         1.1     0.9     9     1      1.1033 0.887  2.885    2.885         0.0050    -52.7   1.0079   0 1000 -1000 500 -500 3;
		12      12   1       1       -360    -1.66   		0 1.0        0.001  0.01 1 1 0.01 1 0.001   0.01 1 345         1.1     0.9     9     1     1.1033 0.887  2.885    2.885         0.0050    -52.7   1.0079   0 1000 -1000 500 -500 3;
		13      13   1       1       -360    -1.66   		0 1.0        0.001  0.01 1 1 0.01 1 0.001   0.01 1 345         1.1     0.9     9     1      1.1033 0.887  2.885    2.885         0.0050    -52.7   1.0079   0 1000 -1000 500 -500 3;
		14      14   2       1       -360    -1.66   		0 1.0        0.001  0.01 1 1 0.01 1 0.001   0.01 1 345         1.1     0.9     9     1      1.1033 0.887  2.885    2.885        0.0050    -52.7   1.0079   0 1000 -1000 500 -500 3;
];
